﻿Public Class clsJpMst
    Public Function getAllList() As DataTable
        Dim szSql As String = String.Empty
        szSql &= "SELECT name || '  (' || spec  || ')'as jp_name ,* FROM sf.t_mst_jp "
        szSql &= " WHERE 1 = 1 "
        Dim dt As DataTable = DBacs.ExecuteSql(szSql, -1)
        Return dt
    End Function

    Public Function selectAll(typ As String, model As String, spec As String) As DataTable
        Dim szSql As String = "SELECT * FROM sf.t_mst_jp WHERE 1 = 1 and validity = '1' "
        If String.IsNullOrEmpty(typ) = False Then
            szSql &= " and type = '" & typ & "'"
        End If
        If String.IsNullOrEmpty(model) = False Then
            szSql &= " and model = '" & model & "'"
        End If
        If String.IsNullOrEmpty(spec) = False Then
            szSql &= " and spec like '%" & spec & "%'"
        End If
        Return DBacs.ExecuteSql(szSql, -1)
    End Function
End Class
